<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // var arr = new Array(1,2,3);
        var abc= [8,5,10];
        var str = [1,5,0];
        Array.prototype.sorted= function(item){
            if(Array.isArray(item)){
                item.sort((a,b)=>{
                    return a-b;
                })
                console.log(item)
            }
        }
        // console.log(arr.sort(arr))
        // console.log(arr.sort(obj))

        str.sorted(abc)
    </script>
</body>
</html>